#ifndef log_h__sldfkjasdlfkaflaksdflashfdasd
#define log_h__sldfkjasdlfkaflaksdflashfdasd

#define LOG_INPUT  0
#define LOG_DIST   1
#define LOG_STACK  2
#define LOG_PERM   3
#define LOG_NET    4
#define LOG_ERR    5

void log(int type);
void printLogLine();
std::stringstream logstream;


#include "tlg.h"


/**
 * Method to flush log message to stdout. 
 */
void log(int type){
	switch(type){
		case (LOG_INPUT):
#ifdef DEBUG_INPUT
			printLogLine();
#endif
			break;
		case (LOG_DIST):
#ifdef DEBUG_DIST
			printLogLine();
#endif
			break;
		case (LOG_STACK):
#ifdef DEBUG_STACK
			printLogLine();
#endif
			break;
		case (LOG_PERM):
#ifdef DEBUG_PERM
			printLogLine();
#endif
			break;
		case (LOG_NET):
#ifdef DEBUG_NET
			printLogLine();
#endif
			break;
	}
	
	logstream.str("");
}

void printLogLine(){
	std::cout << (int)my_rank << ": "; 
	for(int i=0; i<my_rank; i++)
		std::cout << "  ";
	std::cout << logstream.str() << std::endl;
}


#endif // log_h__sldfkjasdlfkaflaksdflashfdasd
